<?php
 
define('IN_SCRIPT',1);

/* Get all the required files and functions */
require_once('hd_settings.inc.php');
require_once('language/'.$hd_settings['language'].'.inc.php');
require_once('inc/common.inc.php');
hd_session_start();
hd_isLoggedIn();

$random=rand(10000,99999);

$ids=hd_input($_POST['id'],"$hdlang[conn_wait].</p><p>&nbsp;</p>
<p align=\"center\"><a href=\"admin_main.php?Refresh=$random\">$hdlang[c2c]</a>");

require_once('inc/database.inc.php');
hd_dbConnect() or hd_error("$hdlang[cant_connect_db] $hdlang[contact_webmsater] $hd_settings[webmaster_mail]!");

$i=0;

/* DELETE */
if ($_POST['a']=="connected") {
$title = "connection given";
$msg = "Connection for the selected rooms where now Updated";

    foreach ($_POST['id'] as $this_id)
    {
        $this_id=hd_isNumber($this_id,$hdlang['id_not_valid']);
        $sql="update stud_approved set connected=1 where con_no=$this_id";
        $result = hd_dbQuery($sql) or hd_error("$hdlang[cant_sql]: $sql</p><p>$hdlang[mysql_said]:<br>".mysql_error()."</p><p>$hdlang[contact_webmsater] $hd_settings[webmaster_mail]");
        $i++;
    }
}  
/* Print header */
require_once('inc/header.inc.php');

/* Print admin navigation */
require_once('inc/show_admin_nav.inc.php');

?>
</td>
</tr>
<tr>
<td>

<p>&nbsp;</p>

<h3 align="center"><?php echo $title; ?></h3>

<p>&nbsp;</p>

<p align="center"><b><?php printf($msg,$i); ?>.</p>
<center> <a href="admin_main.php"><?php echo $hdlang['c2c']; ?></a> &nbsp; &nbsp; 
 <a href="new_connection.php"><?php echo $hdlang['c']; ?></a></center> 
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<hr width="750">



<?php

/* Print footer */
require_once('inc/footer.inc.php');
exit();

?>
